package vista;

import Principal.Main;

import controlador.AccesoControlador;
import controlador.AlertaControlador;
import controlador.ListaInteresControlador;
import controlador.ParkingControlador;
import controlador.UsuarioControlador;
import controlador.VehiculoControlador;
import informes.InformeRegistroParkingVistaImp;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import modelo.AccesoModelo;
import modelo.AlertaModelo;
import modelo.ListaInteresModelo;
import modelo.ParkingModelo;
import modelo.UsuarioModelo;
import modelo.VehiculoModelo;
import modelo.entidades.Usuario;
import vista.Acceso.AccesoMantenimientoVistaImp;
import vista.Acceso.AccesoVista;
import vista.Alerta.AlertaVista;
import vista.Alerta.AlertaVistaImp;
import vista.ListaInteres.ListaInteresVista;
import vista.ListaInteres.ListaInteresVistaImp;
import vista.Parking.ParkingVista;
import vista.ParkingMantenimiento.ParkingMantenimientoVistaImp;
import vista.Usuario.UsuarioVista;
import vista.Usuario.UsuarioVistaImp;
import vista.Vehiculo.VehiculoVista;
import vista.Vehiculo.VehiculoVistaImp;

/**
 *
 * @author jjcamacho
 */
public class Menu extends javax.swing.JFrame {

    private Usuario usuario;
    AccesoModelo accesoModelo;
    AccesoControlador accesoControlador;
    ParkingModelo parkingModelo;
    ParkingControlador parkingControlador;
    VehiculoModelo vehiculoModelo;
    VehiculoControlador vehiculoControlador;
    UsuarioModelo usuarioModelo;
    UsuarioControlador usuarioControlador;
    AlertaModelo alertaModelo;
    AlertaControlador alertaControlador;
    ListaInteresModelo listaInteresModelo;
    ListaInteresControlador listaInteresControlador;

    public Menu(Usuario usuario) {
        setIconImage(new ImageIcon(getClass().getResource("Img/logo.png")).getImage());
        initComponents();
        this.usuario = usuario;
        this.accesoModelo = Main.getAccesoModelo();
        this.accesoControlador = Main.getAccesoControlador();
        this.parkingModelo = Main.getParkingModelo();
        this.parkingControlador = Main.getParkingControlador();
        this.vehiculoModelo = Main.getVehiculoModelo();
        this.vehiculoControlador = Main.getVehiculoControlador();
        this.usuarioModelo = Main.getUsuarioModelo();
        this.usuarioControlador = Main.getUsuarioControlador();
        this.alertaModelo = Main.getAlertaModelo();
        this.alertaControlador = Main.getAlertaControlador();
        this.listaInteresModelo = Main.getListaInteresModelo();
        this.listaInteresControlador = Main.getListaInteresControlador();

    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        imgLogo = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        bnAccesos = new javax.swing.JButton();
        bnParkings = new javax.swing.JButton();
        bnListasInteres = new javax.swing.JButton();
        bnUsuarios = new javax.swing.JButton();
        bnVehiculos = new javax.swing.JButton();
        bnAlertas = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        bnCerrar = new javax.swing.JButton();
        bnSalir = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jBInformes = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Centilium - Panel de Control");
        setLocationByPlatform(true);
        setName("fMenu"); // NOI18N
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
        });

        imgLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/casco2.png"))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(imgLogo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(imgLogo)
                .addContainerGap(53, Short.MAX_VALUE))
        );

        bnAccesos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/Camara2.PNG"))); // NOI18N
        bnAccesos.setMnemonic('A');
        bnAccesos.setText("Accesos");
        bnAccesos.setPreferredSize(new java.awt.Dimension(145, 50));
        bnAccesos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnAccesosActionPerformed(evt);
            }
        });

        bnParkings.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/Barrera.png"))); // NOI18N
        bnParkings.setMnemonic('P');
        bnParkings.setText("Parkings");
        bnParkings.setPreferredSize(new java.awt.Dimension(145, 50));
        bnParkings.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnParkingsActionPerformed(evt);
            }
        });

        bnListasInteres.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/lista.png"))); // NOI18N
        bnListasInteres.setMnemonic('L');
        bnListasInteres.setText("Listas interés");
        bnListasInteres.setPreferredSize(new java.awt.Dimension(145, 50));
        bnListasInteres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnListasInteresActionPerformed(evt);
            }
        });

        bnUsuarios.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/usuarios.png"))); // NOI18N
        bnUsuarios.setMnemonic('U');
        bnUsuarios.setText("Usuarios");
        bnUsuarios.setPreferredSize(new java.awt.Dimension(145, 50));
        bnUsuarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnUsuariosActionPerformed(evt);
            }
        });

        bnVehiculos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/vehiculo.png"))); // NOI18N
        bnVehiculos.setMnemonic('V');
        bnVehiculos.setText("Vehiculos");
        bnVehiculos.setPreferredSize(new java.awt.Dimension(145, 50));
        bnVehiculos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnVehiculosActionPerformed(evt);
            }
        });

        bnAlertas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/alerta.png"))); // NOI18N
        bnAlertas.setMnemonic('G');
        bnAlertas.setText("Gestión alertas");
        bnAlertas.setPreferredSize(new java.awt.Dimension(145, 50));
        bnAlertas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnAlertasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bnListasInteres, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bnUsuarios, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bnAccesos, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(bnParkings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(bnVehiculos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(bnAlertas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bnAccesos, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                    .addComponent(bnParkings, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bnUsuarios, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bnVehiculos, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bnListasInteres, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                    .addComponent(bnAlertas, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)))
        );

        bnCerrar.setMnemonic('s');
        bnCerrar.setText("Cerrar sesión");
        bnCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnCerrarActionPerformed(evt);
            }
        });

        bnSalir.setMnemonic('C');
        bnSalir.setText("Cerrar aplicación");
        bnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnSalirActionPerformed(evt);
            }
        });

        jBInformes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/lista2.png"))); // NOI18N
        jBInformes.setMnemonic('I');
        jBInformes.setText("Informes");
        jBInformes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBInformesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jBInformes, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jBInformes)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE)))
                    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(bnSalir)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(bnCerrar)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bnCerrar)
                    .addComponent(bnSalir))
                .addContainerGap())
        );

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents

    private void bnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnCerrarActionPerformed
        dispose();
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new Login().setVisible(true);
            }
        });
    }//GEN-LAST:event_bnCerrarActionPerformed

    private void bnAccesosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnAccesosActionPerformed
        generarVentanasMantenimientoAcceso(accesoModelo, accesoControlador);
    }//GEN-LAST:event_bnAccesosActionPerformed

    private void bnParkingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnParkingsActionPerformed
        generarVentanasMantenimientoParking(parkingModelo, parkingControlador);
    }//GEN-LAST:event_bnParkingsActionPerformed

    private void bnUsuariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnUsuariosActionPerformed
        generarVentanasUsuario(usuarioModelo, usuarioControlador);
    }//GEN-LAST:event_bnUsuariosActionPerformed

    private void bnVehiculosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnVehiculosActionPerformed
        generarVentanasVehiculo(vehiculoModelo, vehiculoControlador,usuario);
    }//GEN-LAST:event_bnVehiculosActionPerformed

    private void bnListasInteresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnListasInteresActionPerformed
        generarVentanasListaInteres(listaInteresModelo, listaInteresControlador);
    }//GEN-LAST:event_bnListasInteresActionPerformed

    private void bnAlertasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnAlertasActionPerformed
        generarVentanasAlerta(alertaModelo, alertaControlador);
    }//GEN-LAST:event_bnAlertasActionPerformed

    private void bnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnSalirActionPerformed
        String si = "Sí, estoy seguro";
        String no = "No, prefiero continuar";
        Object[] opciones = {si, no};
        int res = JOptionPane.showOptionDialog(
                null,
                "Esta acción desconectará todas las cámaras y cerrará la aplicación.\n" +
                "                                    ¿Seguro que quiere salir?\n",
                "Advertencia",
                JOptionPane.YES_NO_OPTION,
                JOptionPane.QUESTION_MESSAGE,
                null,
                opciones,
                no);
        if (res == JOptionPane.YES_OPTION) {
            System.exit(0);
        }
    }//GEN-LAST:event_bnSalirActionPerformed

    private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
        Boolean permitir = usuario.getTipo().equals("admin");
        bnSalir.setEnabled(permitir);
        bnAccesos.setEnabled(permitir);
        bnParkings.setEnabled(permitir);
        bnUsuarios.setEnabled(permitir);
        bnListasInteres.setEnabled(permitir);
        bnAlertas.setEnabled(permitir);
        jBInformes.setEnabled(permitir);

    }//GEN-LAST:event_formWindowActivated

    private void jBInformesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBInformesActionPerformed
     InformeRegistroParkingVistaImp informe = new InformeRegistroParkingVistaImp(Main.getRegistroParkingControlador(),Main.getRegistroParkingModelo());
         VentanaGeneral1 ventana = new VentanaGeneral1(informe);
         ventana.setTitle("Informes");
         ventana.setSize(425, 225);
         ventana.setVisible(true);
        
    }//GEN-LAST:event_jBInformesActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bnAccesos;
    private javax.swing.JButton bnAlertas;
    private javax.swing.JButton bnCerrar;
    private javax.swing.JButton bnListasInteres;
    private javax.swing.JButton bnParkings;
    private javax.swing.JButton bnSalir;
    private javax.swing.JButton bnUsuarios;
    private javax.swing.JButton bnVehiculos;
    private javax.swing.JLabel imgLogo;
    private javax.swing.JButton jBInformes;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables

    public static void generarVentanasAlerta(AlertaModelo am, AlertaControlador ac) {
        List<AlertaVista> alertaVistas = new ArrayList<AlertaVista>();
        AlertaVista alert = new AlertaVistaImp();
        alertaVistas.add(alert);
        VentanaGeneral1 ventana = new VentanaGeneral1(alert);
        ventana.setTitle("Gestión de Alertas");
        ventana.display();
        ac.setup(am, alertaVistas);
    }
    /*ajimber*/

    public static void generarVentanasVehiculo(VehiculoModelo vm, VehiculoControlador vc,Usuario usuario) {
        List<VehiculoVista> vehiculoVistas = new ArrayList<VehiculoVista>();
        VehiculoVista vehiculo = new VehiculoVistaImp(usuario);
        vehiculoVistas.add(vehiculo);
        VentanaGeneral1 ventana = new VentanaGeneral1(vehiculo);
        ventana.setTitle("Gestión de Vehiculos");
        ventana.display();
        vc.setup(vm, vehiculoVistas);
    }

    public static void generarVentanasUsuario(UsuarioModelo um, UsuarioControlador uc ) {
        List<UsuarioVista> usuarioVistas = new ArrayList<UsuarioVista>();
        UsuarioVista usuario = new UsuarioVistaImp();
        usuarioVistas.add(usuario);
        VentanaGeneral1 ventana = new VentanaGeneral1(usuario);
        ventana.setTitle("Gestión de Usuarios");
        ventana.display();
        uc.setup(um, usuarioVistas);
    }

    public static void generarVentanasMantenimientoAcceso(AccesoModelo am, AccesoControlador ac)
    {
        List<AccesoVista> accesoVistas = new ArrayList<AccesoVista>();
        AccesoVista acceso = new AccesoMantenimientoVistaImp();
        accesoVistas.add(acceso);
        VentanaGeneral1 ventana = new VentanaGeneral1(acceso);
        ventana.setTitle("Gestión de Mantenimiento de Accesos");
        ventana.display();
        ac.setup(am, accesoVistas);
    }
 public static void generarVentanasMantenimientoParking(ParkingModelo pm, ParkingControlador pc) {
        List<ParkingVista> parkingVistas = new ArrayList<ParkingVista>();
        ParkingVista parking = new ParkingMantenimientoVistaImp();
        parkingVistas.add(parking);
        VentanaGeneral1 ventana = new VentanaGeneral1(parking);
        ventana.setTitle("Gestión de Mantenimiento de parkings");
        ventana.display();
        pc.setup(pm, parkingVistas);
    }
    public void generarVentanasListaInteres(ListaInteresModelo lim, ListaInteresControlador lic) {
        List<ListaInteresVista> listaInteresVista = new ArrayList<ListaInteresVista>();
        ListaInteresVista lista = new ListaInteresVistaImp();
        listaInteresVista.add(lista);
        VentanaGeneral1 ventana = new VentanaGeneral1(lista);
        ventana.setTitle("Lista de Interes");
        ventana.display();
        lic.setup(lim, listaInteresVista);
    }


}
